Skip to content

Add channelVisibility support to Thread, Channel, and Slack adapter#51

Merged
nandorojo merged 8 commits intomainfrom
v0/fernandorojo-867fa5c0
Mar 25, 2026
Merged

Add channelVisibility support to Thread, Channel, and Slack adapter#51
nandorojo merged 8 commits intomainfrom
v0/fernandorojo-867fa5c0

Conversation

@nandorojo
Copy link
Collaborator

@nandorojo nandorojo commented Feb 17, 2026

Slack Connect channels can leak internal context (repo summaries, etc.) to external organizations. This PR adds channel visibility awareness to the SDK so consumers can gate behavior based on what kind of channel a thread is in.

  • Introduces a ChannelVisibility enum type ("private" | "workspace" | "external" | "unknown") to distinguish between private channels, workspace-public channels, and externally shared (Slack Connect) channels
  • Adds getChannelVisibility?(threadId) as an optional method on the Adapter interface, and channelVisibility as a readonly property on Postable, Thread, Channel, and their serialized forms
  • Implements visibility detection in the Slack adapter using is_ext_shared_channel from webhook payloads, is_ext_shared/is_private from conversations.info API responses, and channel ID prefix heuristics (C = workspace, D/G = private)
  • Caches external channel status per channel ID from incoming webhook events for fast lookups
  • Other adapters (Discord, Teams, GChat, GitHub, Linear) require no changes since the method is optional and defaults to "unknown"
  • Adds serialization/deserialization support with backward compatibility ("unknown" when missing from JSON)
  • Adds tests for serialization round-trips, channel inheritance, and all visibility variants

All 358 tests pass.

Slack Thread

Co-authored-by: Fernando Rojo <13172299+nandorojo@users.noreply.github.com>
@vercel
Copy link
Contributor

vercel bot commented Feb 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
chat Ready Ready Preview, Comment, Open in v0 Mar 25, 2026 6:41pm
chat-sdk-nextjs-chat Ready Ready Preview, Comment, Open in v0 Mar 25, 2026 6:41pm
the-real-chat-sdk-nextjs-chat Ready Ready Preview, Comment, Open in v0 Mar 25, 2026 6:41pm
v0-chat-fy Error Error Open in v0 Mar 25, 2026 6:41pm

@github-actions
Copy link
Contributor

Preview Branch Testing

To test this PR with real webhook traffic:

  1. Go to /settings on the production deployment
  2. Enter this PR's Vercel preview URL
  3. Save - all webhook requests will now be proxied to this preview

To disable: Clear the URL on the settings page.

Co-authored-by: Fernando Rojo <13172299+nandorojo@users.noreply.github.com>
haydenbleasel and others added 2 commits February 24, 2026 16:06
# Conflicts:
#	packages/adapter-slack/src/index.ts
#	packages/chat/src/channel.ts
#	packages/chat/src/serialization.test.ts
#	packages/chat/src/thread.ts
#	packages/chat/src/types.ts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@haydenbleasel
Copy link
Contributor

@nandorojo updated this branch for ye

@kavinvalli kavinvalli changed the title Add isExternalChannel support to Thread, Channel, and Slack adapter Add channelVisibility support to Thread, Channel, and Slack adapter Mar 25, 2026
@nandorojo nandorojo merged commit 4166e09 into main Mar 25, 2026
11 checks passed
@nandorojo nandorojo deleted the v0/fernandorojo-867fa5c0 branch March 25, 2026 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants